<template>
  <div class="wrap header">
    <div>
      <div class="logo"></div>
    </div>
    <ul class="nav">
      <li :class="{current:$route.path =='/home'}" @click="$router.push('/home')">首页</li>
      <li :class="{current:$route.path=='/goods'}" @click="$router.push('/goods')">全部商品</li>
      <li :class="{current:$route.path=='/user'}" @click="$router.push('/user')">个人中心</li>
      <li :class="{current:$route.path=='/order'}" @click="$router.push('/order')">我的订单</li>
      <li :class="{current:$route.path=='/free'}" @click="$router.push('/free')">专属福利</li>
    </ul>
    <div class="search">
      <input type="text" placeholder="输入关键字" v-model="keyword" />
      <span @click="search">
        <img src="../assets/img/search.png" alt="" />
      </span>
    </div>
  </div>
</template>
                                                
<script>
export default {
  name: "LaoliuHeader",

  data() {
    return {
      keyword:''
    };
  },

  mounted() {},
  methods: {
    search(){
      // console.log("n内容是：" ,this.keyWord);
      this.$router.push(`/goods?keyword=${this.keyword}`)
    }
  },
};
</script>

<style lang="less" scoped>
.header {
  height: 118px;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .logo {
    width: 330px;
    height: 72px;
    background: url(../assets/img/indexLogo.6f8ac4f0.png), no-repeat;
    background-size: 100% 100%;
  }
  .nav {
    width: 500px;
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    font-family: SourceHanSansSC;
    font-weight: 500;
    .current {
      color: #0a328e;
    }
  }
  .search {
    height: 40px;
    display: flex;
    input {
      width: 214px;
      height: 40px;
      border: 1px solid #dedede;
      border-radius: 20px 0px 0px 20px;
      outline: none;
      padding-left: 20px;
      box-sizing: border-box;
    }
    span {
      width: 50px;
      height: 40px;
      background: #0a328e;
      border-radius: 0px 20px 20px 0px;

      line-height: 40px;
      text-align: center;
      img {
        width: 17px;
        height: 17px;
      }
    }
  }
}
</style>